#include <iostream>
using namespace std;

class Complex {
public:
    double real, imag;

    Complex(double r = 0.0, double i = 0.0) : real(r), imag(i) {}

   
    Complex operator+(const Complex &b) const {
        return Complex(real + b.real, imag + b.imag);
    }

   
    Complex operator-(const Complex &b) const {
        return Complex(real - b.real, imag - b.imag);
    }

    friend Complex operator+(const Complex &a, const Complex &b);
    friend Complex operator-(const Complex &a, const Complex &b);

    void display() const {
        cout << "(" << real << " + " << imag << "i)" << endl;
    }
};

Complex operator+(const Complex &a, const Complex &b) {
    return Complex(a.real + b.real, a.imag + b.imag);
}

Complex operator-(const Complex &a, const Complex &b) {
    return Complex(a.real - b.real, a.imag - b.imag);
}

int main() {
    Complex c1(1.0, 2.0), c2(3.0, 4.0), c3, c4, c5, c6;

    c3 = c1 + c2;
    cout << "";
    c3.display();

    c4 = c1 - c2;
    cout << "";
    c4.display();

    c5 = operator+(c1, c2);
    cout << "";
    c5.display();

    c6 = operator-(c1, c2);
    cout << "";
    c6.display();

    return 0;
}
